import 'package:base_flutter/base_flutter.dart';
import 'package:ls_work/a_yyt/models/medical_elder_entity.dart';
import 'package:ls_work/model/health/health_model.dart';
import 'package:ls_work/ui/select_old_page.dart';

import '../../a_yyt/models/health_record_entity.dart';
class NewHealthReportListViewModel extends BaseListViewModel<HealthRecordInfo>{
  NewHealthReportListViewModel(super.context);

  var model = HealthModel();

  MedicalElderInfo? elder;

  @override
  Future<List<HealthRecordInfo>> requestListData() async {
    return await model.healthRecordList(customerId: elder?.id,page: page,rows: pageLength);
  }

  @override
  void onCreated() {
    super.onCreated();
    requestRefresh();
  }

  void chooseOld(){
    Go().push(SelectOldPage((old) {
      Go().pop();
      elder = old;
      notifyListeners();
      requestRefresh();
    }));
  }

}